package com.tnl.app.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.tnl.app.entity.OrderDesc;
import com.tnl.base.BaseDAO;

@Repository
public class HunterDescDAO {
	private static final String SQL_GET_BY_ID = "select b.id as id,b.tag as tag,GROUP_CONCAT(b.name separator '|') as name from tb_hunter_desc a left join tb_orderdesc b ON a.orderdescId=b.id where a.isdelete=0 and a.hunterId=? GROUP BY b.tag order by b.id asc limit 0,5";
	private static final String SQL_GET_TAG_BY_HUNTER = "select DISTINCT(b.tag)as tag from tb_hunter_desc a left join tb_orderdesc b ON a.orderdescId=b.id where a.isdelete=0 and a.status=1 and a.hunterId=? order by b.id asc ";
	
	/**
	 * 查询当前顾问下所有的咨询服务项目
	 * @param hunterId
	 * @return
	 */
	public List<OrderDesc> getALL(int hunterId) {
		return BaseDAO.queryForList(OrderDesc.class, SQL_GET_BY_ID,hunterId);
	}
	
	
	public List<OrderDesc> getHunterByOrdesc(int hunterId) {
		return BaseDAO.queryForList(OrderDesc.class, SQL_GET_TAG_BY_HUNTER,hunterId);
	}

	

}
